﻿#region License and Copyright Notice

//XOML: XML based object persistence framework

//Copyright (c) 2008 Ananth B.
//All rights reserved.

//The contents of this file are made available under the terms of the
//Eclipse Public License v1.0 (the "License") which accompanies this
//distribution, and is available at the following URL:
//http://www.opensource.org/licenses/eclipse-1.0.php

//Software distributed under the License is distributed on an "AS IS" basis,
//WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
//the specific language governing rights and limitations under the License.

//By using this software in any fashion, you are agreeing to be bound by the
//terms of the License.

#endregion

using System;

namespace Xoml
{
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
    public sealed class XmlnsDefinitionAttribute : Attribute
    {
        private string _assemblyName;
        private string _clrNamespace;
        private string _xmlNamespace;

        public XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace, string assemblyName)
        {
            if (xmlNamespace == null)
                throw new ArgumentNullException("xmlNamespace");
            if (clrNamespace == null)
                throw new ArgumentNullException("clrNamespace");
            if (assemblyName == null)
                throw new ArgumentNullException("assemblyName");
            _xmlNamespace = xmlNamespace;
            _clrNamespace = clrNamespace;
            _assemblyName = assemblyName;
        }

        public string AssemblyName
        {
            get
            {
                return _assemblyName;
            }
            set
            {
                _assemblyName = value;
            }
        }

        public string ClrNamespace
        {
            get
            {
                return _clrNamespace;
            }
        }

        public string XmlNamespace
        {
            get
            {
                return _xmlNamespace;
            }
        }
    }
}